package com.kyz.speechsdk.utlis;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringFilter {
    public static String filterSpecChar(String str) {
        String regEx = "[`~!@#$%^&*()+=|{}':;\",\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(str);
        return m.replaceAll("").trim();
    }

    public static String filterSpecCharRec(String str) {
        String regEx = "[!?！。？]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(str);
        return m.replaceAll("").trim();
    }
}
